package com.fr.plugin.customloginpage.service;

import com.fr.json.JSONObject;
import com.fr.plugin.customloginpage.config.Config;
import com.fr.plugin.customloginpage.config.CustomConfig;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

public class ConfigGetHttpHandler extends AbstractHttpHandler {
    public static final String GET_PATH = "/getConfig";

    @Override
    public String urlPath() {
        return GET_PATH;
    }

    @Override
    public void deal(HttpServletRequest req, HttpServletResponse res, JSONObject para, JSONObject result) throws Exception {
        CustomConfig config = Config.getInstance().getCustomConfig();
        String jsonStr = config.getJsonStr();
        result.put(AbstractHttpHandler.STATE_NAME, true).put("data", jsonStr);
    }

}
